﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAccessLayer
{
    public class ActingManagerRepository
    {
        StationeryInventoryEntities1 ent;
        
        public ActingManagerRepository()
        {
            ent = new StationeryInventoryEntities1();
        }

        #region Select Method
        public ActingManager GetLatestActingManagerByDepartmentID(string deptId)
        {
            ActingManager actingManager = new ActingManager();

            var actingMgr = ent.ActingManagers.LastOrDefault(x => x.DeptID == deptId);

            if (actingMgr != null)
            {
                actingManager = actingMgr;
            }

            return actingManager;
        }
        #endregion

    }
}
